<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

// $router->get('/', function () use ($router) {
//     return $router->app->version();
// });

// $router->get('/api/ads/target', 'Api\AdController@getTarget');

$router->group(['prefix'	=>	'/api',	'namespace'	=>	'Api'], function () use ($router){
	$router->get('/ads/target', 'AdController@getTarget');
	$router->get('/ads/get', 'AdController@getAd');
});


$router->group(['prefix'	=>	'/manage',	'namespace'	=>	'Manage'], function() use ($router) {
	$router->group(['prefix'	=>	'/ad'], function() use ($router) {
		$router->get('/provider', 'AdController@listProvider');
		$router->post('/provider', 'AdController@addProvider');

		$router->get('/position', 'AdController@listPosition');
		$router->post('/position', 'AdController@addPosition');

		$router->get('/cpcconfig', 'AdController@listCpcConfig');
		$router->post('/cpcconfig', 'AdController@setCpcConfig');

		$router->get('/cost', 'AdController@listAdCost');
		$router->post('/cost', 'AdController@setAdCost');
	});
});